/**
 * Created by win7 on 2017/3/15.
 */
import Relay from "react-relay";

export default class EnterpriseDetailMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { enterpriseDetail }`;
    }

    getVariables() {
        return {
            argsInput: {
                enterpriseId: this.props.enterpriseId
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on enterpriseDetailPayload {
            data {
                errorCode
                value
                totalResult
                id
                token
                enterprise{
                    telephone
                    updateTime
                    userName
                    userId
                    depName
                    bankAccount
                    enterpriseCode
                    address
                    roleId
                    roleName
                    isCreateUser
                    depId
                    enterpriseId
                    region
                    entype
                    serviceTypeName
                    mainService
                    status
                    taxpayerNo
                    createBy
                    createTime
                    bankName
                    remark
                    countryType
                    serviceType
                    permissionId
                    userStatus
                    employeeNum
                    city
                    userPhone
                    bankNo
                    mainServiceName
                    enterpriseName
                    password
                    province
                    updateBy
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on enterpriseDetailPayload {
                    data {
                        errorCode
                        value
                        totalResult
                        id
                        token
                        enterprise{
                            telephone
                            updateTime
                            userName
                            userId
                            depName
                            bankAccount
                            enterpriseCode
                            address
                            roleId
                            roleName
                            isCreateUser
                            depId
                            enterpriseId
                            region
                            entype
                            serviceTypeName
                            mainService
                            status
                            taxpayerNo
                            createBy
                            createTime
                            bankName
                            remark
                            countryType
                            serviceType
                            permissionId
                            userStatus
                            employeeNum
                            city
                            userPhone
                            bankNo
                            mainServiceName
                            enterpriseName
                            password
                            province
                            updateBy
                        }
                    }
                }
            `]
        }];
    }

}